<template>
	<view :class="themeName">
		<image style="width: 100%;background-color: #fff;" :src="msg.image" mode=""></image>
		<view class="boxes">
			<view class="back bold md">{{msg.title}}</view>
			<view>
				<view class="flex m-t-20">
					<text class="md muted">订单编号：</text>
					<text class="md black">{{msg.sn}}</text>
				</view>
				<view class="flex m-t-20">
					<text class="md muted">服务门店：</text>
					<text class="md black">{{msg.shop.name}}</text>
				</view>
				<view class="flex2 m-t-20">
					<text class="md muted" style="white-space: nowrap;">服务地址：</text>
					<text class="md black">{{msg.shop.address}}</text>
				</view>
				<view class="flex m-t-20">
					<text class="md muted">服务机器：</text>
					<text class="md black">{{msg.jiqiren.title}}</text>
				</view>
				<view class="flex m-t-20">
					<text class="md muted">服务时长：</text>
					<text class="md black">{{msg.total_num}}分钟</text>
				</view>
				<view class="flex m-t-20">
					<text class="md muted">支付状态：</text>
					<text class="md black" v-if="msg.order_status == 0">待付款</text>
					<text class="md black" v-else-if="msg.order_status == 1">待服务</text>
					<text class="md black" v-else-if="msg.order_status == 2">服务中</text>
					<text class="md black" v-else-if="msg.order_status == 3">已完成</text>
				</view>
				<view class="flex m-t-20">
					<text class="md muted">实付金额：</text>
					<text class="md black">￥{{msg.total_amount}}</text>
				</view>
				<view class="flex m-t-20">
					<text class="md muted">下单时间：</text>
					<text class="md black">{{msg.time}}</text>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import { orderInfo } from '@/api/others.js';
	export default {
		data() {
			return {
				id:'',
				msg:{
					shop:{},
					jiqiren:{}
				}
			}
		},
		async onLoad(options) {
			this.id = options.id;
			await this.getMsg();
		},
		methods: {
			getMsg(){
				orderInfo({id:this.id}).then(res => {
					this.msg = res;
				});
			},
		}
	}
</script>

<style lang="scss" scoped>
.boxes{
	background-color: #fff;
	margin: 20rpx;
	padding: 20rpx;
	border-radius: 10rpx;
}
</style>
